home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / cert / trk3_eg / error / fil_open / errors.bas < prev    next >
Encoding:
BASIC Source File  |  1993-04-06  |  1.3 KB  |  54 lines

  1. Global fname As String
  2. Global dirtyflag As Integer
  3.  
  4. Global Const OK = 0
  5. Global Const ABORTRETRYIGNORE = 2
  6. Global Const YESNOCANCEL = 3
  7. Global Const YESNO = 4
  8.  
  9. Global Const RETRYCANCEL = 5
  10.  
  11. Global Const CRITICAL = 16
  12. Global Const WARNINGQUERY = 32
  13. Global Const WARNINGMESSAGE = 48
  14.  
  15. Global Const FIRSTBUTTON = 0
  16. Global Const SECONDBUTTON = 256
  17.  
  18. Global Const MODAL = 1
  19.  
  20. Global Const KEYCANCEL = 2
  21. Global Const KEYABORT = 3
  22. Global Const KEYRETRY = 4
  23. Global Const KEYIGNORE = 5
  24. Global Const KEYYES = 6
  25. Global Const KEYNO = 7
  26.  
  27. Global Const DEFAULT = 0
  28. Global Const HOURGLASS = 11
  29.  
  30. Function DealWithDriveError (ErrorCode As Integer) As Integer
  31.     Dim msgtype As Integer
  32.     Dim mymsg As String
  33.     Dim msgtitle As String
  34.  
  35.     Dim KeyPressed As Integer
  36.  
  37.     'Determine the File Error
  38.     Select Case ErrorCode
  39.         Case 68, 76 'Device Unavailable
  40.             mymsg = " Drive Not Ready   "
  41.             msgtype = ABORTRETRYIGNORE + WARNINGMESSAGE
  42.             msgtitle = "DRIVE ERROR"
  43.         Case Else ' Any other error
  44.             mymsg = "Some other error " + Str$(ErrorCode) + " " + Error$
  45.             msgtype = OK
  46.             msgtitle = "Unknown Error"
  47.     End Select
  48.               
  49.     KeyPressed = MsgBox(mymsg, msgtype, msgtitle)
  50.     DealWithDriveError = KeyPressed
  51.  
  52. End Function
  53.  
  54.